package model

import "github.com/gogf/gf/v2/util/gmeta"

type RechargeRuleIdReq struct {
	Id string `json:"id"  dc:"充值规则id"    v:"required#充值规则id必填"`
}

type RechargeRuleIdRes struct {
	Id string `json:"id"  dc:"充值规则id"`
}

type RechargeRuleIdAndInfoRes struct {
	*RechargeRuleIdReq
	*RechargeRuleInfoRes
}

type RechargeRuleInfoRes struct {
	RechargeMoney float64 `json:"rechargeMoney"  dc:"充值金额满recharge_money 送 ruleType"  v:"required|float#充值金额必填|充值金额格式不正确"`
	RuleName      string  `json:"ruleName"  dc:"充值规则名"  v:"required|length:1,20#规则名称|充值规则名称请在1~20字之间"`
	RuleType      int     `json:"ruleType"   dc:"充值类型1 赠送金额(give_money)"  v:"required|in:1#充值类型必填|充值类型:1"`
	GiveMoney     float64 `json:"giveMoney"   dc:"赠送金额" v:"required-if:ruleType,1|float#充值类型为1赠送金额必填|赠送金额格式不正确"`
	RuleRemark    string  `json:"ruleRemark"    dc:"规则备注" v:"length:1,100#规则备注在1~100字之间"`
}

type RechargeRuleListReq struct {
	RuleName  string `json:"ruleName" dc:"充值规则名称" v:"length:1,20#充值规则名称请在1~20字之间"`
	CompanyId int64  `json:"companyId"   dc:"公司id"`
	*Paging
}

type RechargeRuleDbRes struct {
	gmeta.Meta    `orm:"table:lot_recharge_rule"`
	RechargeMoney float64              `json:"rechargeMoney"  dc:"充值金额满recharge_money 送 ruleType"  v:"required|float#充值金额必填|充值金额格式不正确"`
	RuleName      string               `json:"ruleName"  dc:"充值规则名"  v:"required|length:1,20#规则名称|充值规则名称请在1~20字之间"`
	RuleType      int                  `json:"ruleType"   dc:"充值类型1 赠送金额(give_money)"  v:"required|in:1#充值类型必填|充值类型:1"`
	GiveMoney     float64              `json:"giveMoney"   dc:"赠送金额" v:"required-if:ruleType,1|float#充值类型为1赠送金额必填|赠送金额格式不正确"`
	RuleRemark    string               `json:"ruleRemark"    dc:"规则备注" v:"length:1,100#规则备注在1~100字之间"`
	Id            string               `json:"id"  dc:"充值规则id"`
	CreatedAt     string               `json:"createdAt" dc:"创建时间" `
	CompanyId     int64                `json:"companyId"   dc:"公司id"`
	CompanyInfo   *CompanyIdAndInfoRes `json:"companyInfo" dc:"公司详情" orm:"with:id=company_id"`
}

type RechargeRuleListRes struct {
	List []RechargeRuleDbRes `json:"list" dc:"充值规则列表"`
	PutPage
}
